package pub.tbc.api.handler;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import lombok.extern.slf4j.Slf4j;

/**
 * @author tbc on 2017/3/1 16:43:44.
 */
@Slf4j
public abstract class AbstractHttpInboundHandler<FullHttpRequest> extends SimpleChannelInboundHandler<FullHttpRequest> {
    @Override
    public void exceptionCaught(ChannelHandlerContext context, Throwable cause) {
        log.error("发生异常： {}", cause.getMessage());
        context.close();
        context.fireChannelRead(cause);
    }
}
